package dao.impl;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import dao.inter.Login;
import net.sf.json.JSONObject;
import utils.DBGetDataUtil;
import utils.Pub;

public class LoginImpl implements Login {
	public static final Logger logger = LogManager.getLogger(LoginImpl.class.getName());

	@Override
	public boolean getJsonResultByAccount(String account, String password) throws Exception {
		boolean result = false;
		String sql = "select pwd from users where ID = '" + account + "'";
		String pwd = DBGetDataUtil.getPwd(sql, password);
		logger.info("数据库得到密码：" + pwd);
		logger.info("加密后的密码：" + pwd);
		if (pwd.trim().equals(password)) result = true;
		return result;
	}
}
